import request from '@/utils/request.js'

// 查找地址列表
export function apiGetAddrList(data){
	return request({
		url:'/address/list',
		method:'post',
		data:data
	})
}

// 查看默认地址
export function apiGetDefaultAddr(){
	return request({
		url:'/address/getDefault',
		method:'get'
	})
}

// 修改默认地址
export function apiEditDefaultAddr(data){
	return request({
		url:'/address/setDefault',
		method:'put',
		data:data
	})
}

// 查看地址详情
export function apiGetAddrDetail(params){
	return request({
		url:'/address',
		method:'get',
		params:params
	})
}

// 更新地址
export function apiEditAddr(data){
	return request({
		url:'/address',
		method:'put',
		data:data
	})
}
// 删除单个地址
export function apiDelAddr(id){
	return request({
		url:'/address/delete/'+id,
		method:'delete'
	})
}
// 新增地址
export function apiAddAddr(data){
	return request({
		url:'/address',
		method:'post',
		data:data
	})
}

// 批量删除
export function apiDelAddrs(ids){
	return request({
		url:'/address/delete/'+ids,
		method:'delete'
	})
}
